<template>
  <div>
    <el-form inline label-width="80px" label-position="left">
      <el-form-item label="姓名：">
        <el-input v-model="name" placeholder="请输入客户姓名" />
      </el-form-item>
      <el-form-item label="身份证：" prop="idNo">
        <el-input v-model="idNo" placeholder="请输入身份证号" />
      </el-form-item>
      <el-form-item label="手机号：">
        <el-input v-model="phone" placeholder="请输入手机号" />
      </el-form-item>
      <el-form-item style="padding-top: 40px">
        <el-button type="primary" size="medium" @click="searchAll()">查询</el-button>
      </el-form-item>
      <el-form-item style="padding-top: 40px">
        <el-button type="primary" @click="resetQuery" size="medium">
          重置</el-button>
      </el-form-item>
    </el-form>

    <el-table :data="cusData" style="margin-top: 20px">
      <el-table-column type="index" label="序号" />
      <el-table-column prop="name" label="姓名" />
      <el-table-column prop="gender" label="性别">
        <template slot-scope="scope">
          {{ genderEnumText(scope.row.gender) }}
        </template>
      </el-table-column>
      <el-table-column prop="idNo" label="身份证号" />
      <el-table-column prop="cellPhone" label="手机号" />
      <el-table-column prop="modifyDate" label="更新时间" />
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button type="primary" @click="update(scope.row)">修改信息</el-button>
        </template>
      </el-table-column>
    </el-table>

    <el-dialog :visible.sync="showAttachDialog">
      <p>是否需要添加附件？</p>
      <el-button type="primary" @click="handleAttachYes()">是</el-button>
      <el-button @click="handleAttachNo()">否</el-button>
    </el-dialog>

    <el-dialog :visible.sync="showDetails">
      <el-form ref="customerForm" :model="customerInfo" label-width="100px" :rules="rules">
        <el-form-item label="姓名">
          <el-input v-model="customerInfo.name" />
        </el-form-item>
        <el-form-item label="性别">
          <el-select v-model="customerInfo.gender" placeholder="请选择">
            <el-option v-for="item in genderPtions" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="国籍">
          <el-input v-model="customerInfo.nationality" :disabled="true" />
        </el-form-item>
        <el-form-item label="证件类型">
          <el-select v-model="customerInfo.idType" :disabled="true" placeholder="请选择">
            <el-option v-for="item in idTypeEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="证件号码">
          <el-input v-model="customerInfo.idNo" :disabled="true" />
        </el-form-item>
        <el-form-item label="证件到期时间">
          <el-input v-model="customerInfo.idLastDate" />
        </el-form-item>
        <el-form-item label="证件是否长期有效">
          <el-select v-model="customerInfo.idLongEffective" placeholder="请选择">
            <el-option v-for="item in idLongEffectiveEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="移动手机号">
          <el-input v-model="customerInfo.cellPhone" />
        </el-form-item>
        <el-form-item label="注册登录手机号">
          <el-input v-model="customerInfo.mobile" />
        </el-form-item>
        <el-form-item label="住宅电话">
          <el-input v-model="customerInfo.homePhone" />
        </el-form-item>
        <el-form-item label="月收入">
          <el-input v-model="customerInfo.monthIncome" type="number" @input="validateNumberInput('monthIncome')" />
        </el-form-item>
        <el-form-item label="年收入">
          <el-input v-model="customerInfo.yearIncome" type="number" @input="validateNumberInput('yearIncome')" />
        </el-form-item>
        <el-form-item label="其他收入">
          <el-input v-model="customerInfo.otherIncome" type="number" @input="validateNumberInput('otherIncome')" />
        </el-form-item>
        <el-form-item label="社会身份">
          <el-select v-model="customerInfo.socialIdentity" placeholder="请选择">
            <el-option v-for="item in socialIdentityEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="电子邮件">
          <el-input v-model="customerInfo.email" />
        </el-form-item>
        <el-form-item label="婚姻状况">
          <el-select v-model="customerInfo.maritalStatus" placeholder="请选择">
            <el-option v-for="item in maritalStatusnEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="住宅状况">
          <el-select v-model="customerInfo.houseCondition" placeholder="请选择">
            <el-option v-for="item in houseConditionEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="户籍">
          <el-input v-model="customerInfo.censusRegister" />
        </el-form-item>
        <el-form-item label="居住地址（省）">
          <el-input v-model="customerInfo.abodeState" />
        </el-form-item>
        <el-form-item label="居住地址（市）">
          <el-input v-model="customerInfo.abodeCity" />
        </el-form-item>
        <el-form-item label="居住地址（区/县）">
          <el-input v-model="customerInfo.abodeZone" />
        </el-form-item>
        <el-form-item label="详细地址">
          <el-input v-model="customerInfo.abodeDetail" />
        </el-form-item>
        <el-form-item label="教育状况">
          <el-select v-model="customerInfo.qualification" placeholder="请选择">
            <el-option v-for="item in qualificationEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="毕业学校">
          <el-input v-model="customerInfo.graduatedSchool" />
        </el-form-item>
        <el-form-item label="学制">
          <el-input v-model="customerInfo.lengthOfSchooling" />
        </el-form-item>
        <el-form-item label="参加工作时间">
          <el-input v-model="customerInfo.workStandFrom" />
        </el-form-item>
        <el-form-item label="工作年限">
          <el-input v-model="customerInfo.yearsOfWork" />
        </el-form-item>
        <el-form-item label="工作单位">
          <el-input v-model="customerInfo.unitName" />
        </el-form-item>
        <el-form-item label="任职部门">
          <el-input v-model="customerInfo.empDepapment" />
        </el-form-item>
        <el-form-item label="职务">
          <el-input v-model="customerInfo.specificEmpPost" />
        </el-form-item>
        <el-form-item label="岗位性质">
          <el-select v-model="customerInfo.postProperty" placeholder="请选择">
            <el-option v-for="item in postPropertyEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="职级">
          <el-select v-model="customerInfo.postLevel" placeholder="请选择">
            <el-option v-for="item in postLevelEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="单位行业类别">
          <el-select v-model="customerInfo.empType" placeholder="请选择">
            <el-option v-for="item in empTypeEnum" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="单位性质">
          <el-input v-model="customerInfo.empStructure" />
        </el-form-item>
        <el-form-item label="单位电话">
          <el-input v-model="customerInfo.empPhoneExt" />
        </el-form-item>
        <el-form-item label="单位电话分机号">
          <el-input v-model="customerInfo.empPhoneExtNum" />
        </el-form-item>
        <el-form-item label="单位所在省">
          <el-input v-model="customerInfo.empProvince" />
        </el-form-item>
        <el-form-item label="单位所在市">
          <el-input v-model="customerInfo.empCity" />
        </el-form-item>
        <el-form-item label="单位所在区/县">
          <el-input v-model="customerInfo.empZone" />
        </el-form-item>
        <el-form-item label="单位地址/详细地址">
          <el-input v-model="customerInfo.empAdd" />
        </el-form-item>
        <div v-for="(item, index) in customerInfo.contactInfo" :key="index">
          <el-form-item label="联系人关系">
            <el-select v-model="item.contactRelation" placeholder="请选择" @change="handleContactRelationChange(item)">
              <el-option v-for="items in contactRelationEnum" :key="items.value" :label="items.label"
                :value="items.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="联系人姓名">
            <el-input v-model="item.contactName" />
          </el-form-item>
          <el-form-item label="联系人电话">
            <el-input v-model="item.contactMobile" />
          </el-form-item>
          <el-form-item label="联系人姓名(旧)">
            <el-input :disabled="true" v-model="item.contactOldName" placeholder="联系人关系修改后请填写此字段" />
          </el-form-item>
          <el-form-item label="联系人手机号(旧)">
            <el-input :disabled="true" v-model="item.contactOldMobile" placeholder="联系人关系修改后请填写此字段" />
          </el-form-item>
        </div>
        <el-form-item v-if="showRemark" label="备注信息" prop="remark">
          <el-input v-model="customerInfo.remark" required />
        </el-form-item>
        <el-form-item style="padding-top: 10px">
          <el-button v-if="uploadAttach" @click="handlePreSubmit">预提交</el-button>
          <el-button v-if="!uploadAttach" type="primary" @click="handleSubmit">提交</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ischangeselect: false,
      genderEnum: {
        M: "男",
        F: "女",
      },
      showDetails: false,
      showAttachDialog: false,
      needAttachment: false, // 是否需要附件
      showRemark: false, // 是否显示备注信息输入框
      uploadAttach: true, // 是否需要上传附件，是：显示预提交按钮，否：显示提交按钮
      name: "",
      phone: "",
      idNo: "",
      gender: "",
      customerInfo: {
        name: "",
        gender: "",
        idNo: "",
        nationality: "",
        cellPhone: "",
        idLastDate: "",
        idLongEffective: "",
        mobile: "",
        homePhone: "",
        monthIncome: "",
        yearIncome: "",
        otherIncome: "",
        socialIdentity: "",
        email: "",
        maritalStatus: "",
        houseCondition: "",
        censusRegister: "",
        abodeState: "",
        abodeCity: "",
        abodeZone: "",
        abodeDetail: "",
        qualification: "",
        graduatedSchool: "",
        lengthOfSchooling: "",
        workStandFrom: "",
        yearsOfWork: "",
        unitName: "",
        empDepapment: "",
        specificEmpPost: "",
        postProperty: "",
        postLevel: "",
        empType: "",
        empStructure: "",
        empPhoneExt: "",
        empPhoneExtNum: "",
        empProvince: "",
        empCity: "",
        empZone: "",
        empAdd: "",
        contactInfo: [
          {
            contactRelation: "",
            contactName: "",
            contactMobile: "",
            contactOldName: "",
            contactOldMobile: "",
            // contactIdNo: '',
          },
        ],
        remark: "",
        beforeCustomerInfo: undefined,
      },
      cusData: [],

      //社会身份
      socialIdentityEnum: [
        {
          value: "SI01",
          label: "学生",
        },
        {
          value: "SI02",
          label: "在职人员",
        },
        {
          value: "SI03",
          label: "自由职业",
        },
        {
          value: "SI04",
          label: "企业负责人",
        },
        {
          value: "SI05",
          label: "无业",
        },
        {
          value: "SI06",
          label: "退休",
        },
        {
          value: "SI07",
          label: "银行工作",
        },
        {
          value: "SI08",
          label: "房屋中介",
        },
        {
          value: "SI99",
          label: "其他",
        },
      ],

      //婚姻状况
      maritalStatusnEnum: [
        {
          value: "C",
          label: "已婚",
        },
        {
          value: "S",
          label: "未婚",
        },
        {
          value: "D",
          label: "离异",
        },
        {
          value: "O",
          label: "其他",
        },
        {
          value: "W",
          label: "丧偶",
        },
      ],

      //教育情况
      qualificationEnum: [
        {
          value: "A",
          label: "博士及以上",
        },
        {
          value: "B",
          label: "硕士",
        },
        {
          value: "C",
          label: "大学本科",
        },
        {
          value: "D",
          label: "大学专科技术学校",
        },
        {
          value: "E",
          label: "高中中专技校",
        },
        {
          value: "F",
          label: "初中",
        },
        {
          value: "G",
          label: "初中以下",
        },
        {
          value: "H",
          label: "未知",
        },
        {
          value: "M",
          label: "硕士及以上",
        },
      ],

      //住宅状况
      houseConditionEnum: [
        {
          value: "A",
          label: "自置无按揭",
        },
        {
          value: "B",
          label: "自置有按揭",
        },
        {
          value: "C",
          label: "自建房",
        },
        {
          value: "D",
          label: "亲属楼盘",
        },
        {
          value: "E",
          label: "集体宿舍",
        },
        {
          value: "F",
          label: "租房",
        },
        {
          value: "Z",
          label: "其他",
        },
        {
          value: "J",
          label: "公共住宅",
        },
      ],

      //职务
      specificEmpPostEnum: [
        {
          value: "A",
          label: "高级及以上",
        },
        {
          value: "B",
          label: "中级",
        },
        {
          value: "C",
          label: "初级",
        },
        {
          value: "D",
          label: "初级以下",
        },
        {
          value: "E",
          label: "未知",
        },
      ],

      //岗位性质
      postPropertyEnum: [
        {
          value: "A",
          label: "行政机构，企事业单位负责人或高层管理员",
        },
        {
          value: "B",
          label: "行政机构，企事业单位管理人员",
        },
        {
          value: "C",
          label: "专业技术人员",
        },
        {
          value: "D",
          label: "商业，服务人员",
        },
        {
          value: "E",
          label: "农，林，牧，渔水利业生产人员",
        },
        {
          value: "F",
          label: "工人",
        },
        {
          value: "G",
          label: "军人",
        },
        {
          value: "H",
          label: "其他从业人员",
        },
        {
          value: "J",
          label: "经济，金融，法律，教育从业人员",
        },
        {
          value: "K",
          label: "公务员，行政机构办事人员和有关人员",
        },
        {
          value: "L",
          label: "销售/中介/业务代理/促销",
        },
        {
          value: "M",
          label: "保安，防损",
        },
        {
          value: "N",
          label: "个体工商户",
        },
      ],

      //职级
      postLevelEnum: [
        {
          value: "A",
          label: "高级及以上",
        },
        {
          value: "B",
          label: "中级",
        },
        {
          value: "C",
          label: "初级",
        },
        {
          value: "D",
          label: "初级以下",
        },
      ],

      //单位行业类别
      empTypeEnum: [
        {
          value: "A",
          label: "农，林，牧，渔业",
        },
        {
          value: "C",
          label: "制造业",
        },
        {
          value: "B",
          label: "采候业",
        },
        {
          value: "D",
          label: "电力，燃气及水的生产和供应业",
        },
        {
          value: "E",
          label: "建筑业",
        },
        {
          value: "F",
          label: "交通运输，仓储和邮政业",
        },
        {
          value: "G",
          label: "信息运输，计算机服务和软件",
        },
        {
          value: "H",
          label: "批发和零售业",
        },
        {
          value: "I",
          label: "住宿和餐饮业",
        },
        {
          value: "J",
          label: "金融业",
        },
        {
          value: "K",
          label: "房地产业",
        },
        {
          value: "L",
          label: "租赁和商务服务业",
        },
        {
          value: "M",
          label: "科学研究，技术服务业和地质业",
        },
        {
          value: "N",
          label: "水利，环境和公共设备管理业",
        },
        {
          value: "O",
          label: "居民服务和其他服务业",
        },
        {
          value: "P",
          label: "教育",
        },
        {
          value: "Q",
          label: "卫生，社会保障和社会福利业",
        },
        {
          value: "R",
          label: "文化，体育和娱乐业",
        },
        {
          value: "S",
          label: "公共管理和社会组织",
        },
        {
          value: "T",
          label: "国际组织",
        },
        {
          value: "Z",
          label: "其他",
        },
        {
          value: "9",
          label: "未知",
        },
      ],

      //证件是否长期有效
      idLongEffectiveEnum: [
        {
          value: "Y",
          label: "是",
        },
        {
          value: "N",
          label: "否",
        },
      ],

      //证件类型
      idTypeEnum: [
        {
          value: "I",
          label: "身份证",
        },
      ],

      //性别枚举值转换
      genderPtions: [
        {
          value: "M",
          label: "男",
        },
        {
          value: "F",
          label: "女",
        },
      ],

      contactRelationEnum: [
        {
          value: "F",
          label: "父亲",
        },
        {
          value: "H",
          label: "子女",
        },
        {
          value: "B",
          label: "兄弟",
        },
        {
          value: "S",
          label: "姐妹",
        },
        {
          value: "M",
          label: "母亲",
        },
        {
          value: "Y",
          label: "朋友",
        },
        {
          value: "I",
          label: "本人",
        },
        {
          value: "W",
          label: "同事",
        },
        {
          value: "T",
          label: "同学",
        },
        {
          value: "O",
          label: "其他",
        },
        {
          value: "C",
          label: "配偶",
        },
        {
          value: "P",
          label: "父母",
        },
        {
          value: "G",
          label: "兄弟姐妹",
        },
      ],

      rules: {
        remark: [
          {
            required: true,
            message: "请输入备注信息",
            trigger: "blur",
          },
        ],
        idNo: [
          {
            required: true,
            message: "请输入身份证号",
            trigger: "blur",
          },
        ],
        contactOldName: [],
        contactOldMobile: [],
      },
    };
  },

  created: function () {
    var queryData = {
      name: "",
      idNo: "",
      phone: "",
    };

    if (sessionStorage.getItem("personalInfoData")) {
      queryData.name = JSON.parse(
        sessionStorage.getItem("personalInfoData")
      ).custName;
      queryData.idNo = JSON.parse(
        sessionStorage.getItem("personalInfoData")
      ).idNo;
    }
    this.queryInfo(queryData);
  },

  watch: {
    $route: function (to, from) {
      console.log("监听【修改客户信息】route变化");
      this.$destroy();
    },
  },

  methods: {
    validateNumberInput(field) {
      // console.log(field);

      this.customerInfo[field] = this.customerInfo[field].replace(/[^\d.]/g, '');

      if (this.customerInfo[field].indexOf('.') !== -1) {
        this.customerInfo[field] = this.customerInfo[field].slice(0, this.customerInfo[field].indexOf('.') + 1) + this.customerInfo[field].slice(this.customerInfo[field].indexOf('.')).replace(/\./g, '');
      }
    },
    //枚举值换行方法
    genderEnumText(status) {
      return this.genderEnum[status] || "未知状态";
    },
    // 客户信息查询按钮
    searchAll() {
      this.cusData = [];
      // this.cusData = [
      //   {
      //     name: "张三",
      //     gender: "M",
      //     idNo: "110101197208150091",
      //     cellPhone: "13800138000",
      //     modifyDate: "2023-10-01 12:00:00",
      //   },
      // ];

      var data = {};
      if (!this.idNo) {
        window.globalUiKit.notify("提示", "请输入身份证号", "error");
        return;
      } else {
        // console.log("开始查询客户基本信息");
        data.name = this.name;
        data.idNo = this.idNo;
        data.phone = this.phone;
        console.log("data===", JSON.stringify(data));
        this.queryInfo(data);
        // console.log("查询客户基本信息结束=========");
      }
    },
    handleContactRelationChange(item) {
      if (item.contactRelation) {
        this.ischangeselect = true;
      } else {
        this.ischangeselect = false;
      }
    },

    queryInfo(queryData) {
      const config = {
        headers: {
          "Content-Type": "application/json",
          charset: "utf-8",
        },
      };
      if (!queryData) {
        queryData = {
          name: this.name,
          idNo: this.idNo,
          phone: this.phone,
        };
      }
      console.log("调用核心系统客户信息查询接口--------", queryData);
      // eslint-disable-next-line no-undef
      axios
        .post(
          window.CONFIG.tradingUrl + "/CustomerInfo/getInfo",
          queryData,
          config
        )
        .then((res) => {
          console.log("客户基本信息查询结果：", res);
          console.log(res);
          if (res.data.status === "true") {
            console.log("查询客户基本信息成功");
            // 返回信息处理：
            this.beforeCustomerInfo = res.data.data;
            this.cusData = [];
            // this.cusData.push(res.data.data)
            this.cusData = [res.data.data];
            window.globalUiKit.notify(
              "提示",
              "客户基本信息查询成功",
              "success"
            );
          } else {
            this.cusData = [];
            window.globalUiKit.notify(
              "提示",
              "未查询到相关客户基本信息，请联系管理员",
              "info"
            );
            console.log("查询客户基本信息未成功：");
          }
        });
    },

    /** 重置按钮操作 */
    resetQuery() {
      this.name = undefined;
      this.idNo = undefined;
      this.phone = undefined;
    },

    // 修改客户信息按钮：
    update(row) {

      // if (this.$store.getters.GET_OFFLINESTATUS) {
      //   return window.globalUiKit.notify(
      //     "提示",
      //     "离线状态不能修改客户信息！",
      //     "error"
      //   );
      // }

      // 展示确认上传附件弹窗
      this.showAttachDialog = true;
      console.log("===修改行的数据=====", row);
      this.customerInfo.name = row.name;
      this.customerInfo.idNo = row.idNo;
      this.customerInfo.gender = row.gender;
      this.customerInfo.cellPhone = row.cellPhone;
      this.customerInfo.idLastDate = row.idLastDate;
      this.customerInfo.idLongEffective = row.idLongEffective;
      this.customerInfo.mobile = row.mobile;
      this.customerInfo.homePhone = row.homePhone;
      this.customerInfo.monthIncome = row.monthIncome;
      this.customerInfo.yearIncome = row.yearIncome;
      this.customerInfo.otherIncome = row.otherIncome;
      this.customerInfo.socialIdentity = row.socialIdentity;
      this.customerInfo.email = row.email;
      this.customerInfo.maritalStatus = row.maritalStatus;
      this.customerInfo.houseCondition = row.houseCondition;
      this.customerInfo.censusRegister = row.censusRegister;
      this.customerInfo.abodeState = row.abodeState;
      this.customerInfo.abodeCity = row.abodeCity;
      this.customerInfo.abodeZone = row.abodeZone;
      this.customerInfo.abodeDetail = row.abodeDetail;
      this.customerInfo.qualification = row.qualification;
      this.customerInfo.graduatedSchool = row.graduatedSchool;
      this.customerInfo.lengthOfSchooling = row.lengthOfSchooling;
      this.customerInfo.workStandFrom = row.workStandFrom;
      this.customerInfo.yearsOfWork = row.yearsOfWork;
      this.customerInfo.unitName = row.unitName;
      this.customerInfo.empDepapment = row.empDepapment;
      this.customerInfo.specificEmpPost = row.specificEmpPost;
      this.customerInfo.postProperty = row.postProperty;
      this.customerInfo.postLevel = row.postLevel;
      this.customerInfo.empType = row.empType;
      this.customerInfo.empStructure = row.empStructure;
      this.customerInfo.empPhoneExt = row.empPhoneExt;
      this.customerInfo.empPhoneExtNum = row.empPhoneExtNum;
      this.customerInfo.empProvince = row.empProvince;
      this.customerInfo.empCity = row.empCity;
      this.customerInfo.empZone = row.empZone;
      this.customerInfo.empAdd = row.empAdd;
      this.customerInfo.remark = row.remark;
      //this.customerInfo = row?.contactInfo ? {...row.contactInfo[0], ...row} : {...row}
      this.customerInfo = row.contactInfo
        ? { ...row.contactInfo[0], ...row }
        : {
          ...row,
          contactInfo: [{ a: "", b: "", c: "" }],
        };
    },

    // 客户信息修改——上传附件
    handleAttachYes() {
      this.showDetails = true; // 客户修改信息详情
      this.uploadAttach = true;
      // 关闭弹窗
      this.showAttachDialog = false;
    },
    // 客户信息修改——不上传附件
    handleAttachNo() {
      this.showDetails = true; // 客户修改信息详情
      this.uploadAttach = false;
      // 关闭弹窗
      this.showAttachDialog = false;
    },

    handlePreSubmit() {
      console.log("需要添加附件，预提交");
      const config = {
        headers: {
          "Content-Type": "application/json",
          charset: "utf-8",
        },
      };
      // 显示“备注”信息栏
      this.showRemark = true;
      if (this.customerInfo.remark.length <= 0) {
        // 弹窗让客服人员填写备注信息
        this.$message.success("请填写备注信息");
      } else {

        this.customerInfo.beforeCustomerInfo = this.beforeCustomerInfo;
        axios

          .post(
            window.CONFIG.tradingUrl + "/CustomerRecord/pendingInsert",
            this.customerInfo,
            config
          )
          .then((res) => {
            console.log("客户修改预处理：", res);
            if (res.data.status === "true") {
              this.showRemark = false;
              window.globalUiKit.notify("提示", "客户修改预处理成功", "info");
              console.log("预处理成功");
            } else {
              window.globalUiKit.notify("提示", "客户修改预处理失败", "info");
              console.log("客户修改记录基本信息未成功：");
            }
          });
      }
    },
    handleSubmit() {
      // if (this.ischangeselect) {
      //   if (!this.customerInfo.contactInfo[0].contactOldMobile) {
      //     return this.$message.warning("新联系人手机号不能为空");
      //   }
      // }

      console.log("未添加附件，直接提交至综合系统");
      console.log("客户信息修改参数before：", this.customerInfo);
      this.customerInfo.beforeCustomerInfo = this.beforeCustomerInfo;
      console.log("客户信息修改参数：", this.customerInfo);

      const config = {
        headers: {
          "Content-Type": "application/json",
          charset: "utf-8",
        },
      };
      axios
        .post(
          window.CONFIG.tradingUrl + "/CustomerInfoUpdate/updateInfo",
          this.customerInfo,
          config
        )
        .then((res) => {
          console.log(res);
          if (res.data.status === "true") {
            window.globalUiKit.notify("提示", res.data.msg, "success");
          } else {
            // window.globalUiKit.notify('提示', '客户基本信息修改提交综合系统失败，请联系管理员', 'info')
            window.globalUiKit.notify("提示", res.data.msg, "info");
          }
        });
    },
  },
};
</script>

<style>
.colored .el-form-item__label {
  color: red;
}
</style>